// 用户明细格式化( 补全缺失数据结构, 如果 某人员类型未选择, 后台返回该类数据将为null )
import personalFormMod  from '@/components/ivew_conf/organization/personal_detailed'

export default (ctx, next) =>{
    let resData = ctx.params
    let template = new personalFormMod()    
    let keys = {
        isMember: 'member',
        isStaff: 'staff',
        isSales: 'sales'
    };

    if(!resData['extensions']){

        resData['extensions'] =  template['extensions'];

    }else{

        Object.keys(keys).forEach(key =>{

            let propname = keys[key]
            
            if(!resData['extensions'][propname]){
                resData['extensions'][propname] = template['extensions'][propname] 
            }
            
        })

    }

   
    
    next()
}